import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;


public class ExListenter implements ExceptionListener, MessageListener {

	@Override
	public void onException(JMSException exception) {
		System.out.println("异常:"+exception.getMessage());
		System.out.println(exception.getMessage());
	}

	@Override
	public void onMessage(Message message) {
		try {
			Integer.parseInt(((TextMessage)message).getText());
			System.out.println("consumer2 "+((TextMessage)message).getText());
		} catch (JMSException e) {
			e.printStackTrace();
		}
		
	}

}
